package com.example.nacosdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.nacosdemo.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {
    @Update("update product set stock = stock -1 where product_code = #{productCode}")
    void reduce(String productCode);
}
